import components.newUserMessageWindow;
import flash.events.Event;
import mx.managers.PopUpManager;
import mx.events.FlexMouseEvent;

private var newUserPopUpWin:newUserMessageWindow;

private function checkIfShouldOpenNewUserWindow():void
{
	if (!this.isknownUser)
	{
		this.openNewUserPopUpWindow();
	}
}

public function openNewUserPopUpWindow():void
{
	newUserPopUpWin = PopUpManager.createPopUp(this, newUserMessageWindow,true) as newUserMessageWindow;
	newUserPopUpWin.addEventListener(Event.CLOSE, closeNewUserPopUp);
	newUserPopUpWin.addEventListener(FlexMouseEvent.MOUSE_DOWN_OUTSIDE, closeNewUserPopUp);
	PopUpManager.centerPopUp(newUserPopUpWin);
}

private function closeNewUserPopUp(evt:Event):void {
	PopUpManager.removePopUp(newUserPopUpWin);
}